home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / awebgif.lzx / awebgif / awebgif.awebrx < prev    next >
Text File  |  2012-02-16  |  6KB  |  167 lines

  1. /* awebgif.awebrx - Install or uninstall the AWeb GIF plugin */
  2.  
  3. options results
  4.  
  5. if left(address(),5)~="AWEB." then do
  6.    ports=show("P")
  7.    parse var ports dummy "AWEB." portnr .
  8.    if portnr="" then do
  9.       address command "run AWeb3:AWeb-II"
  10.       address command "WaitForPort AWEB.1"
  11.       portnr=1
  12.    end
  13.    address value "AWEB."portnr
  14.    'get activeport'
  15.    address value result
  16. end
  17.  
  18. parse arg args
  19. parse source dummy1 dummy2 called .
  20. i=lastpos(called,'/')
  21. if i==0 then i=lastpos(called,':')
  22. if i>0 then path=left(called,i)
  23. else path=''
  24.  
  25. if args='' then do
  26.    if ~open(tf,"T:awebgifsetup.html","W") then exit
  27.  
  28.    call writeln tf,"<html><head><title>AWeb GIF Setup</title></head>"
  29.    call writeln tf,"<body><h1>AWeb GIF Setup</h1>"
  30.    
  31.    if exists("AWebPath:awebplugin/awebgif.awebplugin") then do
  32.       installed=0
  33.       progress=4
  34.       loops=-1
  35.       lowpri=0
  36.       'getcfg MIME stem m'
  37.       do i=1 to m.0
  38.          if upper(left(m.i.value,10))="IMAGE/GIF;" then do
  39.             parse var m.i.value type ";" ext ";" action ";" file ";" args
  40.             if action='A' & upper(right(file,18))="AWEBGIF.AWEBPLUGIN" then do
  41.                installed=1
  42.                j=index(upper(args),"PROGRESS=")
  43.                if j>0 then do
  44.                   progress=substr(args,j+9)
  45.                   j=verify(progress,"0123456789")
  46.                   if j>0 then progress=left(progress,j-1)
  47.                end
  48.                j=index(upper(args),"LOOPS=")
  49.                if j>0 then do
  50.                   loops=substr(args,j+6)
  51.                   j=verify(loops,"-0123456789")
  52.                   if j>0 then loops=left(loops,j-1)
  53.                end
  54.                if index(upper(args),"ANIMATE=0") then loops=0
  55.                lowpri=(index(upper(args),"LOWPRI")>0)
  56.             end
  57.             leave
  58.          end
  59.       end
  60.  
  61.       call writeln tf,"<table border width=100% bgcolor=#aaccaa><tr><td>"
  62.       call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  63.       call writeln tf,"This form configures AWeb-II to use the <strong> AWeb GIF plugin</strong>."
  64.       call writeln tf,"<input type=hidden name=defprogress value="progress">"
  65.       call writeln tf,"<input type=hidden name=defloops value="loops">"
  66.       call writeln tf,"<ol><li>Select the required modes of operation "
  67.       call writeln tf,"(see <a href='file:///AWebPath:awebplugin/docs/awebgif.html#parameters'>documentation</a> for details)"
  68.       call writeln tf,"<p><ul><li>Progressive display:<br>"
  69.       call writeln tf,"<input type=radio name=progress value=0"
  70.       if progress=0 then call writeln tf," checked"
  71.       call writeln tf,"> No progressive display (fastest)<br>"
  72.       call writeln tf,"<input type=radio name=progress value=4"
  73.       if progress=4 then call writeln tf," checked"
  74.       call writeln tf,"> Standard progressive display<br>"
  75.       call writeln tf,"<input type=radio name=progress value=1"
  76.       if progress=1 then call writeln tf," checked"
  77.       call writeln tf,"> Smooth progressive display (slowest)<br>"
  78.       call writeln tf,"<p><li>Animation playback:<br>"
  79.       call writeln tf,"<input type=radio name=loops value=-1"
  80.       if loops=-1 then call writeln tf," checked"
  81.       call writeln tf,"> Play back animations infinitely<br>"
  82.       call writeln tf,"<input type=radio name=loops value=3"
  83.       if loops=3 then call writeln tf," checked"
  84.       call writeln tf,"> Play back animations only 3 times<br>"
  85.       call writeln tf,"<input type=radio name=loops value=0"
  86.       if loops=0 then call writeln tf," checked"
  87.       call writeln tf,"> No animations (faster and needs less memory)<br>"
  88.       call writeln tf,"<p><li>Multitasking:<br>"
  89.       call writeln tf,"<input type=checkbox name=lowpri value='LOWPRI'"
  90.       if lowpri then call writeln tf," checked"
  91.       call writeln tf,"> Run decoder at low priority<br>"
  92.       call writeln tf,"</ul>"
  93.       call writeln tf,"<p><li><input type=checkbox name=save value=yes checked> Save the new settings"
  94.       call writeln tf,"<p><li><input type=submit value='Install AWeb GIF plugin'>"
  95.       call writeln tf,"</ol></form></table>"
  96.  
  97.       if installed>0 then do
  98.          call writeln tf,"<p><table border width=100% bgcolor=#ccaaaa><tr><td>"
  99.          call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  100.          call writeln tf,"<input type=hidden name=deinstall value=''>"
  101.          call writeln tf,"This form will deinstall the AWeb GIF plugin and reset the default (datatypes) decoder for GIF images."
  102.          call writeln tf,"<ol><li><input type=checkbox name=save value=yes checked> Save the new settings"
  103.          call writeln tf,"<p><li><input type=submit value='De-install AWeb GIF plugin'>"
  104.          call writeln tf,"</ol></form></table>"
  105.       end
  106.  
  107.    end
  108.    else do
  109.       call writeln tf,"Plugin file not found. You have to run the install script first."
  110.    end
  111.    
  112.    call writeln tf,"<p><hr><p><a href='file:///AWebPath:awebplugin/docs/awebgif.html'>Back to documentation</a>"
  113.    
  114.    call close tf
  115.    'open "file:///T:awebgifsetup.html" reload'
  116.    'wait "file:///T:awebgifsetup.html"'
  117.    'allowcmd'
  118.    address command 'delete T:awebgifsetup.html quiet'
  119.  
  120. end
  121. else do
  122.    
  123.    ext="gif"
  124.    rest=";"
  125.    
  126.    'getcfg MIME stem m'
  127.    do i=1 to m.0
  128.       if upper(left(m.i.value,10))="IMAGE/GIF;" then do
  129.          parse var m.i.value type ";" ext ";" action ";" rest
  130.          leave
  131.       end
  132.    end
  133.  
  134.    if upper(left(args,9))="DEINSTALL" then do
  135.       mime="IMAGE/GIF;"ext";;"rest
  136.    end
  137.    else do
  138.       progress=""
  139.       defprogress="4"
  140.       loops=""
  141.       defloops="-1"
  142.       lowpri=""
  143.       save=""
  144.       
  145.       do while args~=""
  146.          parse var args nextarg args
  147.          interpret nextarg
  148.       end
  149.       
  150.       if progress="" then progress=defprogress
  151.       if loops="" then loops=defloops
  152.       mime="IMAGE/GIF;"ext";A;AWebPath:awebplugin/awebgif.awebplugin;PROGRESS="progress" LOOPS="loops lowpri
  153.    end
  154.    
  155.    'setcfg MIME "'mime'" ADD'
  156.  
  157.    if upper(save)="YES" then do
  158.       'savesettings'
  159.    end
  160.  
  161.    'open "file:///AWebPath:awebplugin/docs/awebgif.html"'
  162.  
  163. end
  164.  
  165. exit
  166.  
  167.